package ar.edu.unq.wannaplay.utils;

import java.util.List;

import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.PageableListView;
import org.apache.wicket.markup.html.panel.Panel;

import ar.edu.unq.wannaplay.roles.AbstractLinkAdderStrategy;

public abstract class WPItemListView<E, S> extends PageableListView<E> {

    private S service;

    private List<String> labels;

    private static final long serialVersionUID = 1L;

    private AbstractLinkAdderStrategy user = AbstractLinkAdderStrategy.getUserLoged();

    private Panel panel;

    public WPItemListView(final String id, final S aService, final List<String> labels, final List<E> list,
            final Panel panel) {
        super(id, list, 5);
        this.service = aService;
        this.labels = labels;
        this.setPanel(panel);
    }

    protected abstract void addLinks(ListItem<E> item);

    public void setService(final S service) {
        this.service = service;
    }

    public S getService() {
        return service;
    }

    public AbstractLinkAdderStrategy getUser() {
        return user;
    }

    public List<String> getLabels() {
        return labels;
    }

    public void setUser(final AbstractLinkAdderStrategy user) {
        this.user = user;
    }

    public void setLabels(final List<String> labels) {
        this.labels = labels;
    }

    public Panel getPanel() {
        return panel;
    }

    public void setPanel(final Panel panel) {
        this.panel = panel;
    }

}
